Method SaveByUniqueAsync<TProps>(RedbObject<TProps>, CancellationToken)

Assembly: redb.Core.dll

Upsert by the object key (UNIQUE stage 1, P1): resolve the row by
(scheme, ValueUnique), then save onto it - the values ride the ordinary save
pipeline in the same transaction as the row. Not a single-statement native upsert on
purpose: writing the _objects row via ON CONFLICT/MERGE would bypass the values
pipeline; resolving first costs one indexed probe and reuses everything. A lost
OBJECT-KEY race retries once onto the current winner's row - both the creation race
(the key appeared between the lookup and our insert) and the vanish race (the resolved
row was deleted and the key recreated elsewhere; BR-8, 2026-09-02) - which keeps a
concurrent accept of one key idempotent: exactly one object per key, last writer's
content. A [RedbUnique] PROPERTY violation is never retried: it is not the object
key's business and surfaces as-is ().

public Task<long> SaveByUniqueAsync<TProps>(RedbObject<TProps> obj, CancellationToken cancellationToken = default) where TProps : class, new()